﻿using System;
using Unity.Collections;
using Unity.Netcode;
using UnityEngine;

public struct PlayerData :INetworkSerializable,IEquatable<PlayerData>
{
    public ulong id;
    public FixedString64Bytes name;
    public bool isLive;

    public readonly bool Equals(PlayerData other)
    {        
        return id==other.id && name==other.name;
    }

    public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter
    {        
        serializer.SerializeValue(ref id);
        serializer.SerializeValue(ref name);
        serializer.SerializeValue(ref isLive);
    }
}